// store.js
import { createStore } from 'vuex';

export default createStore({
    state: {
        user: {
            username: '',
            avatar: ''
        }
    },
    mutations: {
        updateUser(state, payload) {
            state.user = payload;
        }
    },
    getters: {
        isAuthenticated(state) {
            return state.user.username !== '';
        }
    }
});
